#ifndef __DUMP_EMBEDDING_ENGINE_H__
#define __DUMP_EMBEDDING_ENGINE_H__ 1

#include <fstream>

#include "lsb/lsb_embedding_engine.h"
#include "types.h"

/**
 * @brief file dump wrapper
 * @author gpitsch and rpoisel
 *
 * implementation of a wrapper around an CLSBEmbeddingEngine
 * that dumps the following three sample streams to files:
 *
 * @li send direction: before the steg payload is embedded
 * @li send direction: after the steg payload is embedded
 * @li receive direction: incoming data that has steg payload embedded
 */
class CDumpEmbeddingEngine : public CLSBEmbeddingEngine
{
public:

	/**
	 * @param pBitSource data source/sink for stego payload
	 * @param pSendOriginalSampleFile outgoing sample data @b before embedding
	 * @param pSendModifiedSampleFile outgoing sample data @b after embedding
	 * @param pRecvModifiedSampleFile incoming sample data with embedded payload
	 */
	CDumpEmbeddingEngine(IBitSource* pBitSource,
			const std::string& pSendOriginalSampleFile,
			const std::string& pSendModifiedSampleFile,
			const std::string& pRecvModifiedSampleFile);
	virtual ~CDumpEmbeddingEngine();

	virtual std::string getIniSectionName() const;

	virtual int embedIntoSamples(int8_t* pSamples, unsigned int pCount, unsigned int pLeak);
	virtual int embedIntoSamples(uint8_t* pSamples, unsigned int pCount, unsigned int pLeak);
	virtual int embedIntoSamples(int16_t* pSamples, unsigned int pCount, unsigned int pLeak);
	virtual int embedIntoSamples(uint16_t* pSamples, unsigned int pCount, unsigned int pLeak);

	virtual int extractFromSamples(int8_t* pSamples, unsigned int pCount, unsigned int pLeak, unsigned int pInBuffer);
	virtual int extractFromSamples(uint8_t* pSamples, unsigned int pCount, unsigned int pLeak, unsigned int pInBuffer);
	virtual int extractFromSamples(int16_t* pSamples, unsigned int pCount, unsigned int pLeak, unsigned int pInBuffer);
	virtual int extractFromSamples(uint16_t* pSamples, unsigned int pCount, unsigned int pLeak, unsigned int pInBuffer);

	inline virtual int changeSettings() { return 0; }

private:
	CDumpEmbeddingEngine();
	CDumpEmbeddingEngine(const CDumpEmbeddingEngine& );
	CDumpEmbeddingEngine& operator=(const CDumpEmbeddingEngine& );

	static const std::string sIniSectionName;

	CLSBEmbeddingEngine* mEmbeddingEngine;
	std::ofstream mSendOriginalSampleStream;
	std::ofstream mSendModifiedSampleStream;
	std::ofstream mRecvModifiedSampleStream;
};

#endif // __DUMP_EMBEDDING_ENGINE_H__

